<?php if(count($this->list) == 0) { ?>
	<div class="msg left">
		<div class="common error" style="border:0;background:#fff;">
			<i class="icon"></i>
			<h4>STOP</h4>
			<div class="msg-bd">No Special found. </div>
		</div>
	</div>
<?php } else { ?>
	<?php 
		$language = new system_setting_language();
		$previous = $this->page - 1;
		$next = $this->page + 1;
		$page = $this->paginator($this->list)->render();
		$page = preg_replace('#<a href="[^"]+">([\d]+)</a>#isU', '<a href="#$1" onclick="return _ajax.load($1);">$1</a>', $page);
		$page = preg_replace('#<a class="previous" href="[^"]+">([^<]+)</a>#isU', '<a href="#' . $previous . '" onclick="return _ajax.load(' . $previous . ');">$1</a>', $page);
		$page = preg_replace('#<a class="next" href="[^"]+">([^<]+)</a>#isU', '<a href="#' . $next . '" onclick="return _ajax.load(' . $next . ');">$1</a>', $page);
	?>
	<table class="list no-border left">
		<?php foreach($this->list AS $row) { ?>
		<tr>
			<td class="narrow center"><?php
				echo $this->form()->checkbox(
						'_special_id[]', 
						$row->getId(), 
						array('id' => '_special_id-' . $row->getId(), 'onclick' => '_ajax.select(\'' . $row->getId() . '\')')
					);?></td>
			<td<?php if(!$row->getIsActive()) {echo ' class="gray"';}?> title="<?php echo $this->date($row->getLastmodified());?>" id="special-title-<?php echo $row->getId();?>">
				<label class="for-checkbox" for="_special_id-<?php echo $row->getId();?>" style="text-align:left;">
					<span><?php echo $this->escape($row->getTitle());?></span>
					<span class="gray">[<?php echo $row->getName();?>]</span>
					[<em class="red" title="<?php echo $row->getPtotal();?> photo(s)"><?php echo $row->getPtotal();?></em>]
					<?php if(!$row->getIsActive()) { ?> <em class="red">(Invalid)</em><?php } ?>
				</label>
			</td>
			<td class="narrow center"><a href="<?php echo $this->url('special/index', array('name' => $row->getName()))->assemble($row->getLang());?>" target="_blank" title="Visit frontend page">Go»</a></td>
		</tr>
		<?php } ?>
	</table>
	<hr/>
	<div style="clear:both;text-align:left;padding:4px 2px;"><?php echo $page;?></div>
<?php } ?>